import javax.swing.JFrame;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class SaveConfig extends JFrame {

	private static final long serialVersionUID = 1L;
	private JComboBox comboBox;
	private JTextField fileName;
	
	public SaveConfig() {
		getContentPane().setLayout(null);
		setBounds(100, 150, 450, 217);
		setTitle("Parametry zapisu");
		String[] values = { "jpeg", "png", "gif", "bmp", "gif" };
		setComboBox(new JComboBox(values));
		getComboBox().setBounds(202, 37, 130, 20);
		getContentPane().add(getComboBox());
		
		JLabel labelType = new JLabel("Format pliku :");
		labelType.setHorizontalAlignment(SwingConstants.RIGHT);
		labelType.setBounds(0, 37, 176, 20);
		getContentPane().add(labelType);
		
		JLabel labelFilename = new JLabel("Nazwa pliku :");
		labelFilename.setHorizontalAlignment(SwingConstants.RIGHT);
		labelFilename.setBounds(0, 76, 176, 20);
		getContentPane().add(labelFilename);
		
		setFileName(new JTextField());
		getFileName().setText("file1");
		getFileName().setBounds(202, 76, 130, 20);
		getContentPane().add(getFileName());
		getFileName().setColumns(10);
		
		JButton btnSave = new JButton("Zapisz");
		btnSave.setBounds(125, 134, 89, 23);
		btnSave.addMouseListener(new MouseAdapter() {
			@Override
			public void mousePressed(MouseEvent arg0) {
				dispose();
			}
		});
		getContentPane().add(btnSave);
		
		JButton discard = new JButton("Anuluj");
		discard.setBounds(226, 134, 89, 23);
		discard.addMouseListener(new MouseAdapter() {
			@Override
			public void mousePressed(MouseEvent arg0) {
				setVisible(false);
			}
		});
		getContentPane().add(discard);
	}


	public void setComboBox(JComboBox comboBox) {
		this.comboBox = comboBox;
	}


	public JComboBox getComboBox() {
		return comboBox;
	}


	public void setFileName(JTextField fileName) {
		this.fileName = fileName;
	}

	public JTextField getFileName() {
		return fileName;
	}
}
